#pragma once

#include <string>
#include <memory>
#include <cstddef>

#include "stream/Data.h"

namespace stream {
namespace impl {
namespace rocksdb {

class Rocksdb;

class Data : public ::stream::Data {
public:
	explicit Data(const std::string & path);

	~Data() override;

	int append(const std::string & key, const std::string & value) override;
    bool get(const std::string & key, std::string & value) override;
    bool size(size_t & sz) const override;
	void clear() override ;
protected:
	bool _open() override ;
	void _close() override;

private:
	std::string _path;
	std::shared_ptr<::stream::impl::rocksdb::Rocksdb> _db;
};

stream::impl::rocksdb::Data *  makeData(const std::string & path);

}//end namespace rocksdb
}//end namespace impl
}//end namespace stream
